package com.example.consumer.service;

import com.example.common.entity.Ad;
import com.example.common.entity.Message;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@FeignClient("server-provider")
public interface AdService {
    //添加
    @PostMapping("/user/addAd")
    public Message addAd(@RequestBody Ad ad);

    //管理员查找全部广告
    @PostMapping("/admin/findAd")
    public List<Ad> findAd();

    //上架广告
    @PostMapping("/admin/upAd")
    public Message upAd(@RequestBody Ad ad);

    //用户查找正上架的广告
    @PostMapping("/user/findAding")
    public List<Ad> findAding(@RequestBody Ad ad);

    //管理员删除已在上架的广告
    @PostMapping("/admin/deleteAding")
    public Message deleteAding(@RequestBody Ad ad);
}
